<div class="box">
    <div class="box-header with-border">
        <h3 class="box-title">个人榜列表</h3>
        <div class="box-tools pull-right">
            <div class="btn-group pull-right" style="margin-right: 10px">
                <a href="/exams" class="btn btn-sm btn-default" title="列表"><i class="fa fa-list"></i><span class="hidden-xs">&nbsp;返回</span></a>
            </div>
        </div>
        <!-- /.box-tools -->
    </div>
    <!-- /.box-header -->
    <div class="box-body" style="display: block;">
        <table class="table table-hover">
            <thead>
            <tr>
                <th>姓名</th>
                @foreach($subject as $val)
                    <th>{{$val['subject_name']}}</th>
                @endforeach
                <th>平均分</th>
                <th>总分</th>
            </tr>
            </thead>

            <tbody>
            @foreach($data as $key=>$val)
                <tr>
                    <td>
                        {{ $val['student_name'] }}
                    </td>
                    @foreach($subject as $v)
                        <th>{{ $val['detail'][$v['subject_code']]['score'] }}</th>
                    @endforeach
                    <td>
                        {{ $val['avg_score'] }}
                    </td>
                    <td>
                        {{ $val['total_score'] }}
                    </td>
                </tr>
            @endforeach
            </tbody>
        </table>
    </div>
    <!-- /.box-body -->
</div>